import Vue from 'vue'
import VueRouter from 'vue-router'

const Index = () => import('../page/index/index.vue')
const Cate = () => import('../page/cate/index.vue')
const Login = () => import('../page/login/index.vue')
const Loginno = () => import('../page/login/loginno.vue')
const Shopcar = () => import('../page/shopcar/index.vue')
const Shoplist = () => import('../page/cate/shoplist.vue')
const Detail = () => import('../page/cate/detail.vue')
const Register = () => import('../page/login/register.vue')
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'index',
    component: Index
  },
  {
    path: '/cate',
    name: 'cate',
    component: Cate
  },
  {
    path: '/cate/:id',
    name: 'shoplist',
    component: Shoplist
  },
  {
    path: '/cate/goods/:id',
    name: 'detail',
    component: Detail
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/loginno',
    name: 'loginno',
    component: Loginno
  },
  {
    path: '/shopcar',
    name: 'shopcar',
    component: Shopcar
  },
  {
    path: '/register',
    name: 'register',
    component: Register
  },
]


const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
